<?php
/**
 * User: i@fedax.cn
 * Time: 2018/7/27 17:45
 */

namespace app\admin\model;


class GoldEgg extends DataBase
{
    protected $name = 'gold_egg';
    protected $autoWriteTimestamp = true;
    protected $createTime = 'add_time';
    public function getUpdateTimeAttr($value)
    {
        return date('Y-m-d H:i:s', $value);
    }

    /**
     * @param $page_config
     * @return \think\Paginator
     * @throws \think\exception\DbException
     */
    public function getDataList()
    {
        $page_config = array(
            'page' => input('offset', 1),
            'list_rows' => input('limit', 100),
        );
        return $this
            ->where('status', '=', '1')
            ->field('id,egg_name,egg_price,start,end,mode_type')
            ->paginate($page_config);
    }
}